package net.hn.hnms.biz.indicator.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import net.hn.hnms.biz.indicator.util.IndicatorBaseUtil;
import net.hn.hnms.sys.common.core.utils.StringUtils;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author 智呈物联 nzw
 * @date 2022/11/10
 */
@Data
public class IndicatorBaseDataVO {
    @TableId(type = IdType.AUTO)
    private Long id;
    @ApiModelProperty(value = "一级指标编码")
    private String indicatorFCode;

    @ApiModelProperty(value = "二级指标编码")
    private String indicatorSCode;

    @ApiModelProperty(value = "三级指标编码")
    private String indicatorTCode;

    @ApiModelProperty(value = "创建时间（指标模型时间，修改后则不再属于原来的模型）")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "一级指标名称")
    private String indicatorFName;

    @ApiModelProperty(value = "二级指标名称")
    private String indicatorSName;

    @ApiModelProperty(value = "三级指标名称")
    private String indicatorTName;

    @ApiModelProperty(value = "指标数值")
    private String indicatorValue;

    @ApiModelProperty(value = "指标数值单位")
    private String indicatorUnit;

    @ApiModelProperty(value = "指标字典类型")
    private String dictType;


    @ApiModelProperty(value = "指标备注")
    private String indincatorRemark;

    private List<IndicatorBaseKeyDTO> keys;

    public List<IndicatorBaseKeyDTO> getKeys() {
        if (!StringUtils.isBlank(this.dictType)) {
            return IndicatorBaseUtil.listByType(this.dictType);
        }else {
            return null;
        }
    }

}

